<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
// 1、获取请求对象
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// req.setAttribute("req", "REQUEST");
// pageContext.setAttribute("req", "pageContext", PageContext.PAGE_SCOPE);
// pageContext.setAttribute("req", "Request", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("req", "SESSION", PageContext.SESSION_SCOPE);
%>
<!-- 全域查找，从域作用范围小的对象开始找，找不到就往大的找 -->
<%=pageContext.findAttribute("req")%>
<hr>
<!-- request域查找，找不到就返回null -->
<%=req.getAttribute("req")%>
</body>
</html>